<?php 
require PATH_LIBRARY.'/Db.php';
require PATH_LIBRARY.'/Functions.php';
require_once(SMARTY_DIR . 'Smarty.class.php');

//instance db.
global $smarty;
$smarty = new Smarty();
$smarty->debugging = true;

$db = new Db(DB_HOST, DB_NAME, DB_USER, DB_PASS);
$db->open();
$project = $db->getProject(PROJECT_ID);
if($project){
    //require
    require PATH_STRUCTURE.'/'.$project['framework_code'].'.php';
    
    $classFramework = "Structure_".$project['framework_code']; 
    $framework = new $classFramework($db, PROJECT_ID);
    $framework->run();
}
$db->close();